<?php

namespace App\Models\Orm;
use Illuminate\Database\Eloquent\Model;

class Sconfig extends Model
{
    const TABLE_NAME = 'config';
    const PRIMARY_KEY = 'id';

    protected $table = self::TABLE_NAME;
    //主键id
    protected $primaryKey = self::PRIMARY_KEY;
    //查询字段
    protected $visible = [];
    //加黑名单
    protected $guarded = [];
    // 上线状态
    const STATUS_OFF = 0;           // 下线
    const STATUS_ON = 1;            // 上线

    // 上线状态
    const S1 = 1;           // 下线
    const S2 = 2;           // 下线
    const S3 = 3;           // 下线
    const S4 = 4;           // 下线



    public static $status_text = [
        self::STATUS_OFF => '下线',
        self::STATUS_ON => '上线',
    ];


    public static $status = [
        self::S1 => 'S1',
        self::S2 => 'S2',
        self::S3 => 'S3',
        self::S4 => 'S4',

    ];
    /**
     * 上线状态
     * @return mixed|string
     */
    public static function getStatusText($status)
    {
        return isset(self::$status_text[$status]) ? self::$status_text[$status] : '未知';
    }


    public static function getStatus($status)
    {
        return isset(self::$status[$status]) ? self::$status[$status] : '未知';
    }

}